<?php
    require("./Utils.php");

    $post = getJsonParamter();
    
    $id = $post['id'];
    $type = $post['type'];

    $conn = getConnection();
    $sql = "UPDATE pet_type SET type = ? WHERE id = ?";

    $result = execute($conn, $sql, $type, $id);

    if($result) getJson(200, '修改成功', null);

    else getJson(500, '修改失败', null);
?>